<!-- Begin: widget - Search Sought -->
<div class="widget search-sought">
    <h1>Você Buscou</h1>
    <ul>
        <?
        if (isset(SearchResult::$params['type'])):
            $type = DbGet::types(SearchResult::$params['type']);
            ?>
            <li>
                <h2>Tipo</h2>
                <p><?= $type->name ?></p>
            </li>
            <?
        endif;
        if (isset($type) && isset(SearchResult::$params['brand'])):
            $brand = DbGet::brands($type->id, SearchResult::$params['brand']);
            ?>
            <li>
                <h2>Marca</h2>
                <p><?= $brand->name ?></p>
                <a href="<?= __BASE_URI__ . preg_replace('/(marca|modelo)\.[^\/]+\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
            </li>
            <?
        endif;
        if (isset($type) && isset($brand) && isset(SearchResult::$params['model'])):
            $model = DbGet::models($type->id, $brand->id, SearchResult::$params['model']);
            ?>
            <li>
                <h2>Modelo</h2>
                <p><?= $model->name ?></p>
                <a href="<?= __BASE_URI__ . preg_replace('/modelo\.[^\/]+\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
            </li>
            <?
        endif;


        if (isset(SearchResult::$params['model']) and isset(SearchResult::$params['version'])):
            $versao = DbGet::modelsversion(SearchResult::$params['model'], SearchResult::$params['version']);
            ?>
            <li>
                <h2>Versão</h2>
                <p><?= $versao->name ?></p>
                <a href="<?= __BASE_URI__ . preg_replace('/versao\.[^\/]+\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
            </li>
            <?
        endif;


        if (isset(SearchResult::$params['initialyear'])):
            ?>
            <li>
                <h2>A partir do ano</h2>
                <p><?= SearchResult::$params['initialyear'] ?></p>
                <a href="<?= __BASE_URI__ . preg_replace('/ano-inicial\.[0-9]+\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
            </li>
            <?
        endif;
        if (isset(SearchResult::$params['finalyear'])):
            ?>
            <li>
                <h2>Até o ano</h2>
                <p><?= SearchResult::$params['finalyear'] ?></p>
                <a href="<?= __BASE_URI__ . preg_replace('/ano-final\.[0-9]+\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
            </li>
            <?
        endif;
        if (isset(SearchResult::$params['initialprice'])):
            ?>
            <li>
                <h2>A partir do preço</h2>
                <p>R$ <?= Util::format_money(SearchResult::$params['initialprice']) ?></p>
                <a href="<?= __BASE_URI__ . preg_replace('/preco-inicial\.[0-9]+\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
            </li>
            <?
        endif;
        if (isset(SearchResult::$params['finalprice'])):
            ?>
            <li>
                <h2>Até o preço</h2>
                <p>R$ <?= Util::format_money(SearchResult::$params['finalprice']) ?></p>
                <a href="<?= __BASE_URI__ . preg_replace('/preco-final\.[0-9]+\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
            </li>
            <?
        endif;
        if (isset(SearchResult::$params['advertiser'])):
            ?>
            <li>
                <h2>Oferecido por</h2>
                <? if (SearchResult::$params['advertiser'] == 'customer'): ?>
                    <p>Particular</p>
                    <a href="<?= __BASE_URI__ . preg_replace('/anunciante\.particular\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
                <? elseif (SearchResult::$params['advertiser'] == 'enterprise'): ?>
                    <p>Revenda</p>
                    <a href="<?= __BASE_URI__ . preg_replace('/anunciante\.revenda\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
                    <?
                endif;
            endif
            ?>
        </li>
        <?
        if (isset(SearchResult::$params['city'])):
            $city = DbGet::city(SearchResult::$params['city']);
            ?>
            <li>
                <h2>Cidade</h2>
                <p><?= $city->name ?></p>
                <a href="<?= __BASE_URI__ . preg_replace('/cidade\.[^\/]+\//s', '', SearchResult::$url) . 'pagina.' . SearchResult::$page ?>"></a>
            </li>
        <? endif ?>
    </ul>
</div> <!-- End -->
